package com.ftf.tp.user.interfaces.facade.http;

import com.ftf.tp.user.application.service.UserApplicationService;
import com.ftf.tp.user.client.facade.http.UserHttpFacade;
import com.ftf.tp.user.client.dto.UserInfoDTO;
import com.ftf.tp.user.interfaces.facade.converter.UserConverter;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author tanghao
 * @date 2022/8/28
 */
@RestController
public class UserHttpFacadeImpl implements UserHttpFacade {

    @Resource
    private UserApplicationService userApplicationService;

    /**
     * 获取当前登录用户的具体信息
     *
     * @return resp
     */
    @Override
    public UserInfoDTO getCurrentUser() {
        return UserConverter.INSTANCE.doToResp(userApplicationService.getUserInfo());
    }
}
